package com.ruoyi.system.service.impl;

import com.ruoyi.system.mapper.AgoniActivityMapper;
import com.ruoyi.system.pojo.entity.Activity;
import com.ruoyi.system.service.IAgoniActivityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class IAgoniActivityServiceImpl implements IAgoniActivityService {
    @Autowired
    private AgoniActivityMapper agoniActivityMapper;

    @Override
    public List<Activity> listActivities() {
        return agoniActivityMapper.listActivities();
    }

    /**
     * TODO: 实现活动相关的业务逻辑，根据设施id查询活动
     */
    @Override
    public List<Activity> getActivitiesByFacilityId(Long facilityId) {
        return agoniActivityMapper.getActivitiesByFacilityId(facilityId);
    }


    /**
     * TODO:实现新增活动的业务逻辑
     * @param activity
     * @return
     */
    @Override
    public int addActivity(Activity activity) {
        int result=0;
    if(agoniActivityMapper.addActivity(activity)==1){
        result=1;
    };
        return result;
    }

}
